From 8a0fce50b1a268ab3d91295d7011dc92a5ab18c2 Mon Sep 17 00:00:00 2001 From: jStmaX! <87650746+jstmaxlol@users.noreply.github.com> Date: Thu, 28 Aug 2025 13:20:28 +0200 Subject: move fish prompts to cfg/ --- cfg/fish_prompt[s].fish | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 cfg/fish_prompt[s].fish (limited to 'cfg/fish_prompt[s].fish') diff --git a/cfg/fish_prompt[s].fish b/cfg/fish_prompt[s].fish new file mode 100644 index 0000000..7cadb12 --- /dev/null +++ b/cfg/fish_prompt[s].fish @@ -0,0 +1,28 @@ +# fish_prompt +function fish_prompt + set -l user (set_color green)$USER(set_color white)"@" + set -l cwd $PWD + set -l home $HOME + + if test "$cwd" = "$home" + echo -e "$user"(set_color green)"~"(set_color white)" => " + else if string match -q "$home/*" $cwd + set -l relative (string replace "$home/" "~/" $cwd) + echo -e "$user"(set_color green)$relative(set_color white)" => " + else + echo -e "$user"(set_color green)$cwd(set_color white)" => " + end +end + +# fish_right_prompt +function fish_right_prompt + set last_status $status + + # check for which color to use + if test $last_status -eq 0 + set color green + else + set color red + end + echo -e (set_color $color)"[$last_status]" +end -- cgit v1.3.1